package main

import (
	"autoTask/crontab"
	"flag"
)

// "study/example"

func main() {

	var fileName string
	flag.StringVar(&fileName, "fileName", "", "php执行的文件")
	//crontab
	cron := crontab.Crontab{}
	cron.Start(fileName)

	/*var secondTime time.Duration
	var shFileName string

	fmt.Println("请输入定时器时间间隔，秒数：")
	fmt.Scanln(&secondTime)
	fmt.Println()
	fmt.Println("请输入sh命令文件名称：")
	fmt.Scanln(&shFileName)

	ticker := time.NewTicker(secondTime * time.Second)
	for _ = range ticker.C {
		cmd := exec.Command("sh", shFileName)
		fmt.Println(cmd)

		err := cmd.Start()
		if err != nil {
			fmt.Println(err)
		}

		fmt.Println(time.Now())
		fmt.Println()
	}*/
}
